export const Event = <K extends keyof HTMLElementEventMap>(elementQuery: string, event: K): MethodDecorator => {
    const el: any = document.querySelector(elementQuery);
    return (target: any, _propertyKey: string | symbol, descriptor: PropertyDescriptor) => {
        if (el === null) {
            return;
        }
        const method = descriptor.value;
        el.addEventListener(event, (e: any) => {
            method && method.apply(target, [e]);
        });
    }
}